<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/index.css"/>
		<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<div class="center">
				<img :src="imgarr[index]" >
			<a href="#" class="left" v-show="index!=0" @click="prev()">
				<img src="img/小于号.png" >
			</a>
			<a href="#" class="right" v-show="index<imgarr.length-1" @click="next()">
				<img src="img/大于号.png" >
			</a>
			</div>
		</div>
		<script>
			var app = new Vue({
				el:"#app",
				data:{
					imgarr:[
						"img/1.png",
						"img/2.png",
						"img/3.png",
						"img/4.png",
						"img/5.png"
					],
					index:0
				},
				methods:{
					prev:function(){
						this.index--
					},
					next:function(){
						this.index++;
					}
				}
			})
		</script>
	</body>
</html>
